/* =============================================
   聊天页面布局 - 左右两大块
   ============================================= */

/* 整体布局 */
.chat-layout {
  display: flex;
  height: calc(100vh - 70px);
  max-width: 100%;
  margin: 0;
  gap: 20px; /* 左右间距 */
  padding: 16px;
  overflow: hidden;
}

/* =============================================
   左侧边栏 - 独立模块
   ============================================= */
.chat-sidebar {
  width: 300px;
  min-width: 300px;
  background: white;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  border-radius: 24px; /* 圆润的圆角 */
}

.chat-sidebar.hide {
  transform: translateX(-100%);
  width: 0;
  min-width: 0;
  opacity: 0;
}

.chat-sidebar.show {
  transform: translateX(0);
  opacity: 1;
}

/* 侧边栏头部 */
.sidebar-header {
  padding: 24px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  border-radius: 24px 24px 0 0; /* 顶部圆角 */
}

.new-chat-btn {
  flex: 1;
  padding: 14px 20px;
  background: white;
  border: none;
  border-radius: 16px; /* 更圆润 */
  font-size: 14px;
  font-weight: 600;
  color: #667eea;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.new-chat-btn:hover {
  background: #f7fafc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.new-chat-btn:active {
  transform: translateY(0);
}

.toggle-sidebar-btn {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 14px; /* 更圆润 */
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.toggle-sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* 搜索框 */
.sidebar-search {
  padding: 20px;
  border-bottom: 1px solid #f1f5f9;
  background: white;
}

.sidebar-search input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 16px; /* 更圆润 */
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
  background: #f8fafc;
}

.sidebar-search input:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.sidebar-search input::placeholder {
  color: #94a3b8;
}

/* 历史记录列表 */
.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fafbfc;
}

.sidebar-list::-webkit-scrollbar {
  width: 6px;
}

.sidebar-list::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.sidebar-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.sidebar-loading,
.sidebar-empty {
  padding: 60px 20px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.sidebar-empty p:first-child {
  font-size: 56px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.sidebar-empty p:last-child {
  font-size: 14px;
  color: #94a3b8;
}

/* 历史记录项 */
.sidebar-item {
  padding: 16px;
  margin-bottom: 10px;
  border-radius: 18px; /* 更圆润的圆角 */
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  border: 2px solid transparent;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); /* 添加轻微阴影，增强分离感 */
}

.sidebar-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #667eea;
  border-radius: 18px 0 0 18px; /* 匹配父元素圆角 */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-item:hover {
  background: white;
  border-color: #e0e7ff;
  transform: translateX(4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1); /* 悬停时阴影更明显 */
}

.sidebar-item:hover::before {
  opacity: 1;
}

.sidebar-item.active {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-color: #667eea;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
}

.sidebar-item.active::before {
  opacity: 1;
}

.sidebar-item-content {
  flex: 1;
  min-width: 0;
}

.sidebar-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 10px;
}

.sidebar-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.sidebar-item-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 6px;
  font-weight: 500;
}

.sidebar-item-preview {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
  word-break: break-word;
}

.sidebar-item-delete {
  width: 34px;
  height: 34px;
  background: rgba(239, 68, 68, 0.1);
  border: none;
  border-radius: 12px; /* 更圆润 */
  cursor: pointer;
  font-size: 16px;
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-item:hover .sidebar-item-delete {
  opacity: 1;
}

.sidebar-item-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.1) rotate(10deg);
}

/* 侧边栏底部 */
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 12px;
  background: white;
  flex-shrink: 0;
  border-radius: 0 0 24px 24px; /* 底部圆角 */
}

.sidebar-action-btn {
  flex: 1;
  padding: 12px 16px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 14px; /* 更圆润 */
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #475569;
}

.sidebar-action-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sidebar-action-btn.danger:hover:not(:disabled) {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
}

.sidebar-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =============================================
   主聊天区域 - 右侧整体模块
   ============================================= */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  background: white; /* 整体白色背景 */
  border-radius: 24px; /* 圆润的圆角 */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.expand-sidebar-btn {
  position: fixed;
  left: 20px;
  top: 90px;
  width: 48px;
  height: 48px;
  background: white;
  border: none;
  border-radius: 16px; /* 更圆润 */
  cursor: pointer;
  font-size: 20px;
  color: #667eea;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
}

.expand-sidebar-btn:hover {
  background: #667eea;
  color: white;
  transform: translateX(4px) scale(1.08);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  gap: 0; /* 移除间距，内容连续 */
  min-height: 0;
  overflow: hidden;
}

/* 聊天头部 */
.chat-header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 36px;
  background: white;
  border-radius: 0; /* 移除圆角 */
  box-shadow: none; /* 移除阴影 */
  border: none;
  border-bottom: 1px solid #f1f5f9; /* 添加底部分隔线 */
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 6px 0;
}

.page-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0;
  font-weight: 500;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 16px; /* 更圆润 */
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.3);
  }
}

.status-text {
  font-size: 14px;
  font-weight: 600;
  color: white;
}

/* =============================================
   快捷操作区域 - 内嵌样式
   ============================================= */
.quick-actions {
  padding: 24px 36px;
  background: white;
  border-radius: 0;
  box-shadow: none;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  animation: fadeInUp 0.5s ease-out;
}

.quick-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-title::before {
  content: '';
  width: 3px;
  height: 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
}

.quick-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  position: relative;
  overflow: hidden;
  min-height: 80px;
}

.quick-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.quick-btn:hover::before {
  opacity: 1;
}

.quick-btn:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
}

.quick-btn:hover .quick-icon,
.quick-btn:hover .quick-label {
  color: white;
  position: relative;
  z-index: 1;
}

.quick-icon {
  font-size: 28px;
  line-height: 1;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.quick-label {
  color: #475569;
  transition: all 0.3s ease;
  font-size: 13px;
  line-height: 1.3;
  position: relative;
  z-index: 1;
  text-align: center;
  word-break: keep-all;
  white-space: nowrap;
}

/* =============================================
   聊天卡片 - 内嵌模块
   ============================================= */
.chat-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  background: white;
  border-radius: 0; /* 移除圆角 */
  box-shadow: none; /* 移除阴影 */
  border: none;
  overflow: hidden;
}

.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  background: #f8fafc;
  scroll-behavior: smooth;
}

.chat-window::-webkit-scrollbar {
  width: 8px;
}

.chat-window::-webkit-scrollbar-track {
  background: transparent;
}

.chat-window::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.chat-window::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 消息容器 */
.message-wrapper {
  display: flex;
  margin-bottom: 24px;
  animation: messageSlideIn 0.4s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-wrapper.user {
  justify-content: flex-end;
}

.message-wrapper.bot {
  justify-content: flex-start;
}

.message {
  display: flex;
  gap: 14px;
  max-width: 75%;
}

.message.user {
  flex-direction: row-reverse;
}

.message.bot {
  flex-direction: row;
}

/* 头像 */
.message-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 2px solid #e2e8f0;
}

/* 消息内容 */
.message-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

/* 消息气泡 */
.message-bubble {
  padding: 18px 22px; /* 增加内边距 */
  border-radius: 20px; /* 更圆润的圆角 */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  position: relative;
}

.message.user .message-bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 8px; /* 收紧角 */
}

.message.bot .message-bubble {
  background: white;
  color: #1e293b;
  border-bottom-left-radius: 8px; /* 收紧角 */
  border: 1px solid #e2e8f0;
}

.message.error .message-bubble {
  background: #fef2f2;
  border: 2px solid #ef4444;
  color: #991b1b;
}

.message-text {
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message-time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 8px;
  font-weight: 500;
}

.message.user .message-time {
  text-align: right;
}

/* 打字指示器 */
.typing-indicator {
  display: flex;
  gap: 6px;
  padding: 18px 22px;
  background: white;
  border-radius: 20px; /* 更圆润 */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border-bottom-left-radius: 8px;
  border: 1px solid #e2e8f0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* =============================================
   结构化卡片样式 - 更圆润
   ============================================= */
.structured-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 18px; /* 更圆润 */
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.struct-section {
  border-bottom: 1px solid #e2e8f0;
}

.struct-section:last-child {
  border-bottom: none;
}

.struct-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  user-select: none;
}

.struct-header:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.struct-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.struct-icon {
  font-size: 20px;
}

.struct-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.struct-toggle {
  font-size: 14px;
  color: #64748b;
  transition: transform 0.3s ease;
}

.struct-content {
  padding: 20px;
  background: white;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 1000px;
  }
}

/* 缺陷项 */
.defect-item {
  padding: 18px;
  background: #f8fafc;
  border-radius: 16px; /* 更圆润 */
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.defect-item:last-child {
  margin-bottom: 0;
}

.defect-item:hover {
  background: white;
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.defect-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.defect-name {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.risk-pill {
  padding: 6px 14px;
  border-radius: 12px; /* 更圆润 */
  font-size: 12px;
  font-weight: 600;
}

.risk-pill.高 {
  background: #fee2e2;
  color: #991b1b;
}

.risk-pill.中 {
  background: #fef3c7;
  color: #92400e;
}

.risk-pill.低 {
  background: #d1fae5;
  color: #065f46;
}

.defect-reason {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 8px;
}

.defect-confidence {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}

/* 检查项 */
.check-item {
  padding: 18px;
  background: #f8fafc;
  border-radius: 16px; /* 更圆润 */
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
}

.check-item:last-child {
  margin-bottom: 0;
}

.check-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 10px;
}

.check-steps {
  list-style: none;
  padding: 0;
  margin: 0;
}

.check-steps li {
  padding: 8px 0 8px 28px;
  position: relative;
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
}

.check-steps li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 8px;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

/* 上传清单 */
.checklist {
  display: grid;
  gap: 8px;
}

.checklist-item {
  padding: 14px 18px;
  background: #f8fafc;
  border-radius: 14px; /* 更圆润 */
  font-size: 14px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.checklist-item:hover {
  background: white;
  border-color: #667eea;
  transform: translateX(4px);
}

.checklist-icon {
  font-size: 16px;
}

/* 关键词标签 */
.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-tag {
  padding: 10px 18px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 1px solid #c7d2fe;
  color: #4338ca;
  border-radius: 24px; /* 更圆润的胶囊形状 */
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.keyword-tag:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* =============================================
   图片展示样式 - 更圆润
   ============================================= */
.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 4px;
}

.image-item {
  position: relative;
  border-radius: 18px; /* 更圆润 */
  overflow: hidden;
  background: white;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
  cursor: pointer;
  aspect-ratio: 1;
}

.image-item:hover {
  border-color: #667eea;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px) scale(1.02);
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  padding: 16px 12px 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-item:hover .image-overlay {
  opacity: 1;
}

.image-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.img-tag {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.img-tag.高 {
  background: rgba(239, 68, 68, 0.9);
  color: white;
}

.img-tag.中 {
  background: rgba(245, 158, 11, 0.9);
  color: white;
}

.img-tag.低 {
  background: rgba(16, 185, 129, 0.9);
  color: white;
}

/* 单图片显示 */
.single-image {
  border-radius: 18px; /* 更圆润 */
  overflow: hidden;
  border: 2px solid #e2e8f0;
  max-width: 100%;
}

.single-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* 检测标签 */
.detection-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detection-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 16px; /* 更圆润 */
  transition: all 0.3s ease;
}

.detection-tag:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.tag-name {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.tag-risk {
  padding: 5px 12px;
  border-radius: 10px; /* 更圆润 */
  font-size: 12px;
  font-weight: 600;
}

.tag-risk.高 {
  background: #fee2e2;
  color: #991b1b;
}

.tag-risk.中 {
  background: #fef3c7;
  color: #92400e;
}

.tag-risk.低 {
  background: #d1fae5;
  color: #065f46;
}

.tag-conf {
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}

/* 输入区域 */
.chat-input-area {
  padding: 28px 36px;
  background: white;
  border-top: 1px solid #f1f5f9; /* 使用细分隔线 */
  flex-shrink: 0;
  border-radius: 0; /* 移除圆角 */
}

.input-wrapper {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
}

.chat-input {
  flex: 1;
  padding: 16px 22px;
  border: 2px solid #e2e8f0;
  border-radius: 16px; /* 更圆润 */
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
  background: #f8fafc;
  font-family: inherit;
}

.chat-input:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.chat-input::placeholder {
  color: #94a3b8;
}

.send-btn {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 16px; /* 更圆润 */
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
}

.send-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.45);
}

.send-btn:active:not(:disabled) {
  transform: translateY(0) scale(1);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.chat-mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.chat-mode-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.chat-mode-toggle span {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.input-hint {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

/* =============================================
   动画
   ============================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================================
   响应式设计
   ============================================= */
@media (max-width: 1200px) {
  .chat-sidebar {
    width: 260px;
    min-width: 260px;
  }
  
  .quick-buttons {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  
  .quick-btn {
    padding: 14px 10px;
    min-height: 75px;
  }
  
  .quick-icon {
    font-size: 26px;
  }
  
  .quick-label {
    font-size: 12px;
  }
}

@media (max-width: 968px) {
  .chat-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    width: 280px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  }

  .chat-container {
    padding: 0;
  }

  .quick-buttons {
    grid
